#ifndef INTERRUPT_HANDLER_H_
#define INTERRUPT_HANDLER_H_

#include <assert.h>
#include <EventHandler.h>

#include "Handlers.h"
#include "../../view/MenuStack.h"

class INTERRUPT_Handler : public EventHandler {

	private:

	public:

		INTERRUPT_Handler () {
		}

		/*
		 * Elimina del MenuStack todos los menues. Lo cual
		 * es condicion de corte del sistema
		 */
		virtual int handleSignal ( int signum ) {
			assert ( signum == INTERRUPT_SIGNAL );
			while (!MenuStack::getInstance()->empty()) {
				MenuStack::getInstance()->pop();
			}
			return 0;
		}
};

#endif /* INTERRUPT_HANDLER_H_ */
